package com.power.bank.core.controller;

import com.power.bank.system.core.model.LoginUser;
import com.power.bank.system.core.utils.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * web层通用数据处理
 * 
 * @author ruoyi
 */
public class BaseController extends com.power.bank.common.core.controller.BaseController
{
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());



    /**
     * 获取用户缓存信息
     */
    public LoginUser getLoginUser()
    {
        return SecurityUtils.getLoginUser();
    }

    /**
     * 获取登录用户id
     */
    public Long getUserId()
    {
        return getLoginUser().getUserId();
    }

    /**
     * 获取登录部门id
     */
    public Long getDeptId()
    {
        return getLoginUser().getDeptId();
    }

    /**
     * 获取登录用户名
     */
    public String getUsername()
    {
        return getLoginUser().getUsername();
    }
}
